package com.cn.service.ShopService;

import com.cn.Mapper.shopMapper.InventoryMapper;
import com.cn.util.SqlsesstionUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

/**
 * @ClassName InventoryService
 * @Description TODO
 * @Author yujiajing
 * @Date 2022/10/16 22:24
 * @Version 1.0
 */
@Service
public class InventoryService {

    public void updateInventoryByCart(){
        SqlSession sqlSession= SqlsesstionUtil.getSqlSession();
        InventoryMapper inventoryMapper =sqlSession.getMapper(InventoryMapper.class);
        inventoryMapper.updateInventoryByCart();
    }
    public  void AddInventoryById(Integer goods_inventory,String goods_id){
        SqlSession sqlSession= SqlsesstionUtil.getSqlSession();
        InventoryMapper inventoryMapper =sqlSession.getMapper(InventoryMapper.class);
        inventoryMapper.addInventory(goods_inventory,goods_id);
    }
}
